<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>个人博客网站</title>
    <link type="text/css" rel="stylesheet"
        href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" />
    <link type="text/css" rel="stylesheet" href="/static/css/layout.css" />
</head>

<body>
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container-fluid">
            <a class="navbar-brand" href="/user/query">游标</a>
            <!-- <button class="navbar-toggler" type="button" data-bs-toggle="collapse"
                data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
                aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarSupportedContent"> 分组和隐藏导航栏内容 -->
            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                <li class="nav-item">
                    <a class="nav-link active" aria-current="page" href="/user/query">用户管理</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link active" href="/link/query">短域名管理</a>
                </li>
            </ul>
            <form class="d-flex" role="search">
                <input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
                <button class="btn btn-outline-success" type="submit">Search</button>
            </form>
            <span class="navbar-text">
                当前登录用户: sonfer
            </span>

        </div>
        </div>
    </nav>
    <div class="container-fluid">
        <div class="row">
            <div class="col-12 table-btn">
                <a class="btn btn-primary" href="/user/add/">新建</a>
            </div>
        </div>

        <div class="row">
            <div class="col-12">
                <table class="table table-striped table-hover table-bordered">
                    <thead class="table-light">
                        <tr>
                            <th>用户名</th>
                            <th>性别</th>
                            <th>地址</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        {{range .users}}
                        <tr>
                            <td>{{.Name}}</td>
                            <td>{{if .Sex}}男{{else}}女{{end}}</td>
                            <td>{{.Addr}}</td>
                            <td>
                                <a class="btn btn-sm btn-warning" href="/user/edit/?id={{.ID}}">编辑</a>
                                <a class="btn btn-sm btn-danger" href="/user/delete/?id={{.ID}}">删除</a>
                            </td>
                        </tr>
                        {{end}}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</body>

</html>